<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/elec/pileOfflineDetail.js"></script>
    <link rel="stylesheet" href="${ctx}/statics/css/update.css">
    <link rel="stylesheet" href="${ctx}/statics/css/common.css">
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.css">
    <script src="${ctx}/libjs/plugins/bootstrap-table-pagejump/bootstrap-table-pagejump.js"></script>
    <%--<link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/skins/laydate.css">--%>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/laydate/laydate.css">
    <script src="${ctx}/libjs/plugins/laydate/laydate.js"></script>
    <link rel="stylesheet" href="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.css">
    <script src="${ctx}/libjs/plugins/bootStrap-table-fixed-column/bootstrap-table-fixed-columns.js"></script>
    <style>
        .layui-card {
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .4) !important;
            text-align: center !important;
            border-top: 1px solid rgb(224, 224, 224);
        }

        .layui-card .layui-card-body {
            margin-top: 0 !important;
            font-size: 14px;
        }

        .layui-card .layui-card-header {
            background: rgba(30, 159, 255, 1);
            color: #fff;
        }

        .refreshTime span {
            font-weight: 700;
        }
    </style>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>设备管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>实时离线桩详情列表</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

    var has_add = '';
    var has_edit = '';
    var has_delete = '';
</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="row" style="padding-bottom: 15px !important;">
                    <input name="elecPileId" id="elecPileId" value="${elecPileId}" type="hidden">
                    <div class="pull-left search ol-md-1">
                        <input id="beginTime" name="beginTime" type="text"
                           class="form-control layer-date input-distance timeInput" autocomplete="false" value="${beginTime}"
                           placeholder="开始时间">
                    </div>
                    <div class="pull-left search ol-md-1">
                        <input id="endTime" name="endTime" type="text"
                           class="form-control layer-date input-distance timeInput" autocomplete="false" value="${endTime}"
                           placeholder="结束时间">
                    </div>
                    <button class="btn btn-success input-distance" onclick="pileOfflineDetail.reLoad()">查询</button>
                    <div class="pull-left search col-md-1">
                        <button type="button" class="btn pull-right btn-primary"
                                onclick="pileOfflineDetail.exportPileOfflineDetail()">
                            导出
                        </button>
                    </div>
                </div>
                <div class="row"
                     style="display: flex;justify-content: space-evenly;padding-bottom: 0.1rem;margin-top: 1px !important;padding-top: 10px !important;">
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">充电站</div>
                            <div class="layui-card-body" id="stationName">
                                ${pileOfflineVo.stationName}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">桩编号</div>
                            <div class="layui-card-body" id="pileNo">
                                ${pileOfflineVo.pileNo}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">离线总时长</div>
                            <div class="layui-card-body" id="offlineTime">
                                ${pileOfflineVo.offlineTime}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2 ">
                        <div class="layui-card">
                            <div class="layui-card-header">离线总次数</div>
                            <div class="layui-card-body" id="offlineCount">
                                ${pileOfflineVo.offlineCount}
                            </div>
                        </div>
                    </div>
                </div>
                <table id="exampleTable" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function selectPileOfflineInfo() {
        var elecPileId=$("#elecPileId").val().trim();
        var beginTime=$("#beginTime").val().trim();
        var endTime=$("#endTime").val().trim();
        $.ajax({
            url: prefix + "/selectPileOfflineInfo?elecPileId="+elecPileId+"&beginTime="+beginTime+"&endTime="+endTime,
            type: "GET",
            success: function (data) {
                console.log(data)
                if (data.status == 200) {
                    document.getElementById("stationName").innerHTML = data.data.stationName;
                    document.getElementById("pileNo").innerHTML = data.data.pileNo;
                    document.getElementById("offlineTime").innerHTML = data.data.offlineTime;
                    document.getElementById("offlineCount").innerHTML=data.data.offlineCount;
                } else {
                    layer.msg(data.message);
                }
            }
        });
    }
    selectPileOfflineInfo();
    pileOfflineDetail.init();
</script>
</body>
</html>
<script>
    // //日期范围限制
    var start = {
        elem: '#beginTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(), //设定最小日期为当前日期
        // max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            $("#endTime").val("")
            end.min = datas
        }
    };
    var end = {
        elem: '#endTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        // theme: '#3195f0',
        // min: laydate.now(),
        // max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    laydate.skin('molv');//皮肤
</script>
